﻿#region Copyright ©2008-2010, Technische Universitaet Muenchen
// ====================================================================================================
//
// Last Changed by       $Author: then $
// Last Changed Date     $LastChangedDate: 2009-06-09 09:28:29 +0200 (Tue, 09 Jun 2009) $
// Last Changed Revision $Rev: 185 $
//
// ====================================================================================================
#endregion

using System.Collections.Generic;
using System.Xml;

namespace Tum.CollabXT
{
    /// <summary>
    /// PET provider interface.
    /// </summary>
    public interface IProvider
    {
        /// <summary>
        /// Dictionary of data that does not fit the given fields.
        /// </summary>
        Dictionary<string, object> ExtendedData
        {
            get;
        }

        /// <summary>
        /// Is called when the provider is requested to serialize its data.
        /// </summary>
        void Serialize(XmlNode outputParentNode);

        /// <summary>
        /// Is called when the provider is requested to deserialize its data.
        /// </summary>
        void Deserialize(XmlNode inputParentNode);
    }

    /// <summary>
    /// Interface fir a process provider (including the intermediate model).
    /// </summary>
    public interface IProcessProvider : IProvider
    {
        /// <summary>
        /// Gets all activities of a project model.
        /// </summary>
        List<IActivity> Activities
        {
            get;
        }

        /// <summary>
        /// Gets all products of a project model.
        /// </summary>
        List<IArtifact> Artifacts
        {
            get;
        }

        /// <summary>
        /// Gets all roles of a project model.
        /// </summary>
        List<IRole> Roles
        {
            get;
        }

        /// <summary>
        /// Gets all disciplines of a project model.
        /// </summary>
        List<IDiscipline> Disciplines
        {
            get;
        }

        /// <summary>
        /// Gets all milestones of a project model.
        /// </summary>
        List<IMilestone> Milestones
        {
            get;
        }

        /// <summary>
        /// Gets all dependencies between basic artifacts.
        /// </summary>
        List<IAssociation> Associations
        {
            get;
        }

        /// <summary>
        /// Gets all topics, describing parts of objects.
        /// </summary>
        List<ITopic> Topics
        {
            get;
        }

        /// <summary>
        /// Gets the process name.
        /// </summary>
        string Name
        {
            get;
        }

        /// <summary>
        /// Gets the process description.
        /// </summary>
        string Description
        {
            get;
        }

        /// <summary>
        /// Gets all tasks of a project model.
        /// </summary>
        List<ITask> Tasks
        {
            get;
        }


        /// <summary>
        /// Initializes a process provider.
        /// </summary>
        /// <param name="log">Log to track status.</param>
        void Initialize(Log log);

        /// <summary>
        /// Gets the name of the config page XAML file or null, if none is needed.
        /// </summary>
        string GetConfigPageName();
    }

    /// <summary>
    /// Interface for a tool provider.
    /// </summary>
    public interface IToolProvider : IProvider
    {
        /// <summary>
        /// Initializes a tool provider using a given process provider.
        /// </summary>
        /// <param name="processProvider">Process provider containing data to be converted</param>
        /// <param name="log">Log to track status</param>
        void Initialize(IProcessProvider processProvider, Log log);

        /// <summary>
        /// Processes the process provider data and outputs the results to the given path.
        /// </summary>
        void Process();

        /// <summary>
        /// Gets the name of the config page XAML file or null, if none is needed.
        /// </summary>
        string GetConfigPageName();
    }
}
